package kr.hkit.androidcomplete01.chaptert10;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

public class ResourceSize extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chapter10_displaysize);
		DisplayMetrics dm = getResources().getDisplayMetrics();
		StringBuilder sb = new StringBuilder();
		sb.append("widthPicels = " + dm.widthPixels + "\n");
		sb.append("heightPicels = " + dm.heightPixels + "\n");
		sb.append("densityDpi = " + dm.densityDpi + "\n");
		sb.append("density = " + dm.density + "\n");
		sb.append("scaledDensity = " + dm.scaledDensity + "\n");
		sb.append("xdpi = " + dm.xdpi + "\n");
		sb.append("ydpi = " + dm.ydpi + "\n");
		TextView tv = (TextView) findViewById(R.id.sizeresult);
		tv.setText(sb);
	}
}
